VB Programming (http://www.moskalyuk.com/jobs/index.htm)

ADO Objects

1)Connection

2)Command (param1,param2)

3)Recordset

ADO Lock types

1)Optimistic

2)Pessimistic

3)BatchOptimistic

4)ReadOnly

ADO Cursor types

1)ForwardOnly

2)Static

3)KeySet

4)Dynamic

 

InProcess- dll ,runs in same process, creates new instance for each appl

OutProcess- exe, runs in different process,

 

1)  A combo box is loaded in the Form_Initialize Event with:

Combo1.additem “Red”
Combo1.additem “Blue”
Combo1.additem “Green”

When is the Combo box Populated?
The combo box gets populated the first time the form is loaded.
The combo box gets populated when a user click on the form.
The combo box gets populated when the form is displayed.

The combo box gets populated the first time the form is loaded.

2)  When should you use an out-of-process com component?
Select all that apply.
When it has a tendency to crash.
When speed is a necessity.
When you use asynchronous programming.
When you want to create a dll.
When you want to create a exe
  When it has a tendency to crash.
  When you use asynchronous programming.
  When you want to create a exe.
3)  An old version of your application was created using the P & D wizard. You write an updated application and use the P & D wizard to create a setup program. You need to uninstall the existing program to use the new one. How do you do this?
Email users and tell them to uninstall the old app before they install the new one.
Edit your setup1.exe file and make the necessary changes.
Increment the version by one.
Compile the program with today’s date.

Increment the version by one.

4)  You write an application for 5000 clients. Your boss tells you to only update users who need the files so that the network doesn’t get bogged down. What should you do?
Place the cab files on the internet.
Place multiple cab files on the intranet.
Email an install.exe file to users who need the upgrade.
Email the cab file to users who need the upgrade
  Place multiple cab files on the intranet
5)  How can you register an ActiveX code component.
Select all that apply:
Use regsvr32.exe
Make a setup program with the P & D wizard.
Open a form that uses the component.
Active X code components do not need to be registered.
  Use regsvr32.exe
  Make a setup program with the P & D wizard.
6)  Private Sub Command1_Click()
  Call Procedure1
End Sub
 


Sub Procedure1()
  Dim str As String
  On Error GoTo Errhandler
  str = "Procedure 1"
  Call procedure2(str)
  str = "Success"
  MsgBox str
  Exit Sub
Errhandler:
  MsgBox "Error in " & str
End Sub


Private Sub procedure2(str)
  str = "Procedure 2"
  Call procedure3(str)
End Sub


Private Sub procedure3(str)
  On Error Goto ErrHandler
  str = "Procedure 3"
  Err.Raise "62101"
Errhandler:
  MsgBox "Error in Procedure 3"
End Sub

When a user clicks the command button what will the last message box displayed say?

A MsgBox saying "Error in Procedure1"
A MsgBox saying "Success"
A MsgBox saying "Error in Procedure2"
A MsgBox saying "Error in Procedure3"

A MsgBox saying "Success"

7)  Using the P & D wizard, you want to distribute a user document. What files do you need to include.
Select all that apply:
project1.exe
project1.vbd
project1.doc
project1.dox
  project1.exe
  project1.vbd
8)  You want to have a textbox populated by a listbox selection when a user clicks on the listbox. How would you do this?
Private sub List1_ click()
  Text1 = List1
End sub
Private sub List1_ click()
  Text1.change = List1
End sub
Private sub List1_ selectedIndex()
  Text1.gotfocus = List1
End sub
Private sub List1_ click()
  Text1.text = List1.selecteditem
End sub

Private sub List1_ click()
  Text1 = List1
End sub

9)  On which of the following lines will the object 'MyObj' be created?

Line 1: Dim MyObj as ServerName.MyClass
Line 2: Set MyObj = New ServerName.MyClass
Line 3: MyObj.ObjMethod
Line 4: MyObj.ObjProperty = True
 
Line 1
Line 2
Line 3
Line 4

Line 2

10)  You are working on an application that has a form named MyForm. MyForm contains a status bar named MyStatusBar. You want to display the text 'Welcome' in the third panel of the status bar. How would you do this?
MyStatusBar.Panels(3).Text = "Welcome"
MyStatusBar.Panels(2).Text = "Welcome"
MyStatusBar.Panels(2).Caption = "Welcome"
MyStatusBar.Panels(3).Caption = "Welcome"

MyStatusBar.Panels(3).Text = "Welcome"

11)  You want to create an Uninstall Wizard for your new application. What is the easiest way to do this?
Create an uninstall.inf file and place it in the same directory with your applications exe file.
Create an uninstall.exe file and place it in the same directory with your applications exe file.
Use the Package and Deployment wizard to create the installation disks.
Create an uninstall program through Visual Basic.

Use the Package and Deployment wizard to create the installation disks.

12)  How many instances of MyInstance are created in the following lines of code:

Dim MyObject as New ServerName.MyInstance
Dim MyObject2 as ServerName.MyInstance
Dim MyObject3 as ServerName.MyInstance
Set MyObject2 = New ServerName.MyInstance
0
1
2
3

1

13)  You want to set a property that has been implemented in an ActiveX Component. Which procedure must you use?
Let
Set
Get
Read

Let

14)  When is the KeyPress event activated?
When the letter 'A' is pressed.
When the ESC key is pressed.
When the F6 key is pressed.
When the Page Up key is pressed

When the letter 'A' is pressed.

15)  Which one is better suited for record-oriented data?
Sequential access
Binary access
Odbc access
Random access

Random access

16)  Which property is required when you use the cellvalue or celltext value?
BoundText
SelectedItem
BoundColumn
Bookmark

Bookmark

17)  Select the benefit of the Data Combo control?
At run time, the user can rearrange columns and rows to provide different views of the data.
Combination of the DataList control and a text box.
It presents fully editable data from multiple fields in an external database.
Automatically filled with a list of data from a field in an external database.

Combination of the DataList control and a text box.

18)  How can you change the Tab order for a control?
By setting the Tab order properties.
By setting the Tab Index properties.
By setting the Index properties.
By setting the Tab properties

By setting the Tab Index properties

19)  What are the ways to create Dialog Boxes?
Normal
Implicit
Predefined
Customized
Built-in
  Predefined
  Customized
20)  What is the extension for a standard module?
.vbp
.cls
.bas
.frm

.bas

21)  Select the benefit of an Active X Document?
Create text document
Displaying design time properties
Insertable objects
Displayable in an Internet Browser such as Internet Explorer
Displayable in an Internet Browser such as Internet Explorer
 
 
22)  Select the Zero-based collection objects?
Menus collection
Controls collection
Class collection
Forms collection

Controls collection

Forms collection
23)  If you want to know the position of the selected item in a list in a combo box, which property will you use?
NewIndex
ListCount
ListItem
ListIndex
24)  What is the browser object based on?
OOPs
Type libraries
OLE
DLL
25)  An event for a control combines the
Procedure name and event name
procedure name and control name
controls actual name and the event name
None of the above
26)  Select the benefits of sequential access over random access?
Close statement
Open statement
Get statement
Input # statement
27)  How many check boxes can be selected at a time?
No more than 25
no more than 100
no more than 150
None of the above
28)  What are the features provided by the Combo box object?
A scrollable list of items from which the user can choose
A small set of items from which a user can choose optionally
A scrollable list of items along with a text edit field
A small set of items from which a user can choose one or more
29)  You want to monitor which cell the user clicks, in this case which event would you use?
Row change event
Col change event
Colrow change event
Rowcol change event
30)  What is the benefit of sub procedures?
avoid the repetition of coding
used in Active X Components
flexible procedure in all type of modules
None of the above
31)  How can the windows be docked with the Multiple Document Interface?
any side of the parent window
any side of the child window
can only be docked beneath the menu bar
can only be docked beneath the context menu bar
32)  How is the working Environment often referred to in Visual Basic?
Form Designer
Development Environment
Integrated Application Environment
Integrated Development Environment
33)  What is the use of the Common Dialog control?
View and edit on standard dialog boxes
Gives formatting, grouping and binding features
Provides operations such as opening, saving files and setting print options
Provides a standard set of dialog boxes for Alerting and signaling features
34)  Objects in Visual Basic are created from
Classes
Standard EXE projects
OLE
Visual Basic Application
35)  How would you best define a Project in Visual Basic?
A Project is a collection of modules
A Project is a collection of functions and procedures
A Project is a collection of Classes and Forms
A Project is a collection of Files
36)  What are the conditions when you give names to your Forms and Controls?
underscore character allowed
punctuation and spaces are allowed
must begin with a number or letter
must begin with a letter
must be no longer than 40 character
37)  How can you define a Property in Visual Basic?
It is a characteristic of a method
It is a characteristic of an object
It is a method of an object
It is a event of a control
38)  What is the syntax for adding to a control array at run time?
set index (n)
unload object (index)
load object (index)
set new index (n)
39)  What is the difference between the array and the collection object?
Avoid more coding
Property setting
Arrays do not need to be re-dimensioned
Collections do not need to be re-dimensioned
40)  How can you create a Front-end database application with minimal code?
By using ODBC concepts
By using OLE DB data source
By using DAO data control
By setting some data properties at design time
41)  In the Form_Load section of your form, you'd like to programmatically bind a TextBox Control named Text1 to an ADO Data Control. What code would you use?
Set Text1.DataSource = Adodc1
Text1.DataField = "ContactName"
Set Text1.DataSource = "Adodc1"
Text1.DataField = "ContactName"
Set Text1.DataSource = Adodc1
Set Text1.DataField = ContactName
Text1.DataSource = Adodc1
Text1.DataField = "ContactName"
Explanation of Answer:
You must use Set with the Datasource property because ADODC is an object. The field name must be in quotations since it is a string variable. ADODC cannot be in quotations.